package com.sali.disruptor.exceptions;

import com.lmax.disruptor.ExceptionHandler;
import com.sali.disruptor.entity.MessageEvent;
import lombok.extern.slf4j.Slf4j;

/**
 * @description:
 * @author: sali
 * @date: 2025/2/22 下午3:07.
 * @version: 1.0
 */
@Slf4j
public class DisruptorExceptionHandler  implements ExceptionHandler<MessageEvent> {
    @Override
    public void handleEventException(Throwable throwable, long l, MessageEvent messageEvent) {
        log.error("disruptor throw handle exception, message:{}", throwable.getMessage(), throwable);
    }

    @Override
    public void handleOnStartException(Throwable throwable) {
        log.error("disruptor throw start exception, message:{}", throwable.getMessage(), throwable);
    }

    @Override
    public void handleOnShutdownException(Throwable throwable) {
        log.error("disruptor throw shutdown exception, message:{}", throwable.getMessage(), throwable);
    }
}
